﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataAccess
{
    public class ConnectDB
    {
        public string ConnectionString()
        {
            try
            {
                return WebConfigurationManager.ConnectionStrings["Connect_DB"].ConnectionString;
            }
            catch 
            {
                string str = null;


                str = "Data Source=.;Initial Catalog=MOCK1_G2_HAUI;Persist Security Info=True;User ID=sa;Password=123456;";

                SqlConnection cn = new SqlConnection(str);
                if (cn.State == ConnectionState.Closed)
                {
                    cn.Open();

                }
                return str;
            }
           
         
        }
    }
}
